import { post ,get, Delete } from "../utils/request";

/**
 * 注册
 * @param {*} data
 *  userName  注意大小写
 *  password  密码
 * @returns
 */
export const regAPI = (data) => post("/api/member/login_v2", data);

/**
 * 验证码登录
 * @param {*} data
 * @returns
 */
export const loginAPI = (data) => post("/api/member/login_v2", data);


/**
 * 账号密码登录
 * @param {*} data 
 * @returns 
 */
export const accountLoginAPI=(data)=>post("/api/member/login_v1",data);

/**
 * 获取验证码
 * @returns 
 */ 

export const codeAPI=(data)=>get("/api/member/code",data);


/**
 * 发布帖子
 */

export const fabuAPI = (data)=>post("/api/post/add",data);


/**
 * 帖子列表
 */
 export const hotPostsAPI = () => get("/api/post/list")



 /**
  * 帖子详情
  */
export const loadDetailAPI = (id) => get("/api/post/query/" + id);

  /**
   * 发布评论
   */
export const commentsAPI = (data)=>post("/api/postcomment/add",data);

   /**
    * 根据帖子ID查其所有评论
    */
export const conDetailAPI = (id) => get("/api/postcomment/find/comment/" + id);

    /**
     * 点赞评论
     */
export const postLikeAPI = (data) => post("/api/postlike/add",data);

     
